package com.zjsy.service.impl;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zjsy.dao.FriendLinkDao;
import com.zjsy.dao.MagazineDao;
import com.zjsy.po.FriendLink;
import com.zjsy.po.FriendLinkModule;
import com.zjsy.service.FriendLinkService;
@Service
@Transactional
public class FriendLinkServiceImpl implements FriendLinkService {
	
	@Autowired
	private FriendLinkDao friendLinkdao;

	@Override
	public List<FriendLink> findFriendLink() {
		
		return friendLinkdao.findFriendLink();
	}

	@Override
	public void addFriend(FriendLinkModule friend) {
		SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
		friend.setUptime(df.format(new Date()));// new Date()为获取当前系统时间
		
		friendLinkdao.addFriends(friend);
		
	}

	@Override
	public FriendLinkModule findFreindLinkById(String id) {
	
		return friendLinkdao.findFreindLinkById(id);
	}

	@Override
	public void uopdateFreindLink(FriendLinkModule friend) {
		
		
		friendLinkdao.updateFreindLink(friend);
		
	}

	@Override
	public void deleteFriendById(String id) {
		
		friendLinkdao.deleteFriendById(id);
		
	}

	

	


}
